const http = require('http');
const server = http.createServer();

server.on('request',(req,res)=>{
    let request = `请求地址：${req.url},请求方式：${req.method}`;
    console.log(request);
    res.setHeader('Content-Type','text/html;charset=utf8');
    res.end(request);
});
server.listen('8081',()=>{
    console.log(`你正在访问:http://127.0.0.1:8081`);
})